<!DOCTYPE html>
<html>
<head>
	<title>E8NET</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <include file="./App/Admin/View/Include/css.html" />
    <link rel="stylesheet" href="__PUBLIC__/Admin/css/compiled/tables.css" type="text/css" media="screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>

    <include file="./App/Admin/View/Include/navbar.html" />
    <include file="./App/Admin/View/Include/menu.html" />


	<!-- main container -->
    <div class="content">

        <div role="breadcrumb">
            <ol class="breadcrumb">
              <li><a href="#">App设置</a> / </li>
              <li><a href="{:U('Version/index')}">版本控制</a> / </li>
              <li class="active">发布版本列表</li>
            </ol>
        </div>

        <div class="container-fluid">
            <div id="pad-wrapper">

                <!-- orders table -->
                <div class="table-wrapper orders-table section">
                    <div class="row-fluid head">
                        <div class="span12 head-pancel">
                            版本控制
                        </div>
                    </div>

                    <div class="row-fluid filter-block">
                        <div class="pull-right">
                            <a href="{:U('Version/add')}" class="btn-flat white new-product">+ 发布新版本</a>
                        </div>
                    </div>
                    <div class="row-fluid filter-block">
                        <div class="pull-right">是否开启版本控制&nbsp;&nbsp;

                            <div class="slider-frame success">
                                <span data-on-text="关闭" data-off-text="开启" <if condition="$updateSwitch eq 1">class="slider-button off"<else/>class="slider-button on"</if> ><if condition="$updateSwitch eq 1">开启<else/>关闭</if></span>
                            </div>
                        </div>
                    </div>



                    <div class="row-fluid">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th class="span2">
                                    ID
                                </th>
                                <th class="span3">
                                    <span class="line"></span>
                                    版本号
                                </th>
                                <th class="span5">
                                    <span class="line"></span>
                                    下载地址
                                </th>
                                <th class="span5">
                                    <span class="line"></span>
                                    版本描述
                                </th>
                                <th class="span3">
                                    <span class="line"></span>
                                    更新类型
                                </th>
                                <th class="span2 align-right">
                                    <span class="line"></span>ACTION
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <!-- row -->
                            <volist name="versionList" id="version">
                                <tr>
                                    <td>{$version.id}</td>
                                    <td>{$version.version_string}</td>
                                    <td>{$version.download_url}</td>
                                    <td>{$version.remark}</td>
                                    <td>
                                        <if condition="$version.update_force eq 1">
                                            <span class="label label-success">强制更新</span>
                                            <else />
                                            <span class="label label-info">非强制更新</span>
                                        </if>
                                    </td>
                                    <td class="align-right">
                                        <a href="javascript:void(0);" onclick="sshow('__APP__/Version/del/id/{$version.id}','版本删除后将导致不能更新')">删除</a>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- end orders table -->

            </div>
        </div>
    </div>
    <!-- end main container -->

    <include file="./App/Admin/View/Include/js.html" />
	<include file="./App/Admin/View/Include/modal.html" />

    <!-- scripts -->
    

    <!-- initialize this page scripts -->
    <script type="text/javascript">
        $(function () {
            // Switch slide buttons
            $('.slider-button').click(function() {
                if ($(this).hasClass("on")) {
                    updateSwitch(1);
                    $(this).removeClass('on').html($(this).data("off-text"));
                } else {
                    updateSwitch(0);
                    $(this).addClass('on').html($(this).data("on-text"));
                }
            });


            function updateSwitch(val) {
                lshow();
                $.post("{:U('Version/updateSwitch')}",{val:val},function(result){
                    var obj = eval('(' + result + ')');
                    lhide();
                });

            }

        });
    </script>

</body>
</html>